<div class="pageContent">
	<form method="post" action="admin.php?mod=user&action=edit" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
        <input type="hidden" name="user_id" value="{$user_id}"/>
        <input type="hidden" name="is_submit" value="1"/>
        <div class="pageFormContent" layoutH="56">
            <dl class="nowrap">
                <dt>{lang username}</dt>
                <dd>
                    <input name="user_name" class="required" type="text" size="30" value="{$user_result['user_name']}" alt="{lang please_input_username}" remote="admin.php?mod=user&action=check_user_name&modify_user_id={$user_id}" />	
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>{lang user_score}</dt>
                <dd>
                    <input name="user_score" class="required" type="text" size="30" value="{$user_result['user_score']}" alt="{lang user_score}" />	
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>{lang realname}</dt>
                <dd>
                    <input name="user_realname" class="required" type="text" size="30" value="{$user_result['user_realname']}" alt="{lang please_input_realname}" />	
                </dd>
            </dl>
			<dl>
				<dt>{lang new_password}</dt>
                <dd>
                    <input name="user_password" class="<!--{if $action == 'add'}-->required<!--{/if}--> alphanumeric" id="password" minlength="6" maxlength="20" type="text" size="30" value="" />
                </dd>
			</dl>
			<dl>
				<dt>{lang password2}</dt>
                <dd>
                    <input name="user_password2" class="<!--{if $action == 'add'}-->required<!--{/if}-->" equalto="#password" type="text" size="30" value="" />
                </dd>
			</dl>
            <dl class="nowrap">
                <dt>{lang user_role}</dt>
                <dd>
                    <input type="hidden" name="lookup_role.user_role_id" value="{$user_result['user_role_id']}"  />
                    <input name="lookup_role.role_name" type="text" value="{$user_result['role_name']}" alt="" readonly/>
                    <a class="btnLook" href="admin.php?mod=user_role&action=lookup_role" lookupGroup="lookup_role">{lang search_return}</a>	
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>{lang user_menu_access}</dt>
                <dd>
                    <input type="hidden" id="user_menu" name="user_menu" value="{$role_result['user_menu']}" />
                    <div id="resultBox"></div>
                    <div style="float:left; display:block; margin:10px; overflow:auto; width:500px; height:200px; overflow:auto; border:solid 1px #CCC; line-height:21px; background:#FFF;">
                        <SCRIPT type="text/javascript">
                            <!--
                            var setting = {
                                view: {
                                    selectedMulti: false
                                },
                                check: {
                                    enable: true
                                },
                                data: {
                                    simpleData: {
                                        enable: true
                                    }
                                },
                                callback: {
                                    beforeCheck: beforeCheck,
                                    onCheck: onCheck
                                }
                            };

                            var zNodes ={$menu_json_string};

                            var code, log, className = "dark";
                            function beforeCheck(treeId, treeNode) {
                                className = (className === "dark" ? "":"dark");
                                return (treeNode.doCheck !== false);
                            }

                            function onCheck(e, treeId, treeNode) {
                                var user_role_menu_nodes_str = '';
                                var user_role_menu_obj = $.fn.zTree.getZTreeObj("user_menu_tree");
                                var user_role_menu_obj_checked_nodes = user_role_menu_obj.getCheckedNodes(true);
                                for (var i=0, l=user_role_menu_obj_checked_nodes.length; i<l; i++) {
                                    user_role_menu_nodes_str = user_role_menu_nodes_str + ',' + user_role_menu_obj_checked_nodes[i]["id"];
                                }
                                $("#user_menu").val(user_role_menu_nodes_str);
                            }

                            function setAutoTrigger(e) {
                                var zTree = $.fn.zTree.getZTreeObj("user_menu_tree");
                                zTree.setting.check.autoCheckTrigger = $("#autoCallbackTrigger").attr("checked");
                                $("#autoCheckTriggerValue").html(zTree.setting.check.autoCheckTrigger ? "true" : "false");
                            }

                            $(document).ready(function(){
                                $.fn.zTree.init($("#user_menu_tree"), setting, zNodes);
                                $("#autoCallbackTrigger").bind("change", {}, setAutoTrigger);
                            });
                            //-->
                        </SCRIPT>
                        <ul id="user_menu_tree" class="ztree"></ul>
                    </div>
                </dd>
            </dl>
            <p>{lang user_menu_access_comment}</p>
        </div>  
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">{lang save}</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">{lang cancel}</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
